Skip to content

fix(cli): route reload, restart and pull-to-refresh intents to existing commands - #5094

Merged
thymikee merged 4 commits into
mainfrom
t3/improve-cli-intent-routing
Nov 25, 2026
Merged

thymikee merged 4 commits into
mainfrom
t3/improve-cli-intent-routing

Conversation

@thymikee

@thymikee thymikee commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Summary

An agent that wanted to pull to refresh, restart an app, or load new JavaScript spent a help read or a failing command on it in every measured run. Each answer now sits with its owner.

The skill routing card names scroll refresh, open <app> --relaunch, and metro reload, and says: when your host allows agent-device by command name, run one call per command. A chained or quoted-path call misses that rule and runs sandboxed, away from the daemon.

src/cli/parser/command-suggestions.ts owns unknown-command hints. reload joins restart in its curated map, and an entry can carry a second shape, so one hint names both working commands; reload used to fall through to the nearest-name match and suggest the unrelated record. usageForUnknownCommand owns what a help read prints for an unknown name: a one-line pointer when a suggestion already answered it, the root card otherwise. help gestures now leads with pull to refresh; help scroll already did.

Before / after

agent-device reload --help

  • Before: Did you mean record? plus the root card, about 3.1 KB.
  • After: Did you mean open <app> --relaunch (or metro reload)? plus one pointer line, 213 bytes.

agent-device help gestures: pull to refresh moved from a mid-topic line to the opening sentence.

Validation

At 24201c5: typecheck, format, lint, build, fallow, layering, agent-guidance, command-docs, doc-prose, doc-links, plus vitest --project unit-core over src, scripts, and test: 20599 passed, 9 skipped. New tests cover the hint, its byte bound, short help output, and first-line mentions. CI owns the rest.

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.60 MB 6.58 MB -20.2 kB
Package (unpacked) 6.60 MB 6.58 MB -20.2 kB
Package (download) 2.01 MB 2.01 MB -5.7 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 21.1 ms 22.7 ms +1.6 ms
CLI --help 47.5 ms 49.0 ms +1.6 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread website/docs/docs/agent-setup.md Resolved
…ng commands

An agent that wanted to pull to refresh, restart an app, or load new
JavaScript spent a help read or a failing command on it in every
measured run.

The skill routing card names scroll refresh, open <app> --relaunch and
metro reload, and tells the agent to run one agent-device call per
command when its host allows commands by name, so a chained or quoted
call does not fall into a sandbox that cannot reach the daemon.

The unknown-command suggestion map gains reload beside restart, and an
entry can carry a second shape so one hint names both working commands
instead of the nearest-name match's unrelated record. A help read for a
name with a confident suggestion prints a one-line pointer instead of
the root decision card, and help gestures leads with pull to refresh.
@thymikee
thymikee force-pushed the t3/improve-cli-intent-routing branch from 7f9db43 to 24201c5 Compare November 25, 2026 09:10
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on 24201c5. The verdict and the full list are in the summary comment.

Comment thread src/cli/parser/args.ts Resolved
… candidates

A one-line pointer replaces the card only when the guess names one command
(a curated alias or a single nearest name); a multi-candidate guess or no guess
keeps the card that shows the candidates' shapes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

No blocking problems were found at ec00c27.

Not blocking: these can be taken or left: run each metro suggestion through its command reader or action list in the drift test, because parsing alone accepts any single positional (or narrow the comment to commands and flags); say that the help scroll test pins existing behavior, or drop it; remove the duplicate restart coverage by dropping it from the first loop (keeping the exact format for start) and deleting the byte-bound test; let one resolver return both the hint and whether it is a single command, so hasSingleCommandSuggestion does not restate the suggestion precedence; give one command per intent in the routing card (open <app> --relaunch to restart, metro reload for a JS-only change with Metro connected) and fix the "one command" comments to match; when the setup sentence is fixed, say that the allow rule must match the path form actually run; keep the sandbox allow-rule guidance short or move it to its own change, since it goes beyond intent routing; in a follow-up, let MCP help map the reload and restart topics through the same suggestion owner (this gap predates the PR); in a follow-up, include help topic ids in nearest-name matching for help reads, because help gestur now points only to gesture and no longer lists topics; trim the test comments that narrate measurements, and correct the PR description, because the gestures sentence now appears twice in the topic rather than moved.

The sandbox sentence wording thread still applies. The test format thread does not apply, because the exact suggestion format stays pinned for reload, restart and other guesses, so it can be resolved.

All 32 checks pass.

Not verified here: the CLI and tests were not run at the PR head, and output byte counts rest on the tests and CI. Host sandbox allow-rule behavior for chained or quoted-path calls was not checked. The diff was compared with merge base c8555bd, not with current base 3fd66c2.

Nothing from this review needs to happen before merge.

thymikee and others added 2 commits November 25, 2026 11:08
…e miss the call

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 8ba738b

Since the review of ec00c27: 0 new · 0 still open · 0 no longer raised

No open findings.

Reviewed with this repository's own Sentinel configuration (3fd66c2b8b0a).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

No blocking problems were found at 8ba738b. Since the earlier review, the setup sentence and the suggestion test were fixed.

Two threads no longer apply and can be resolved: setup sentence, because the failure condition is no longer reversed, and test assertion, because the test now requires the Did you mean open <app> --relaunch prefix.

All 22 checks pass. There are no conflicts with main at 3fd66c2.

Not verified here: the CLI and tests were not run at this commit, so test results rest on CI. Host sandbox allow-rule behavior for chained or quoted-path calls was not checked, and no device run was done for these help, hint, skill and docs text changes.

Nothing from this review needs to happen before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 25, 2026
@thymikee
thymikee merged commit 1c96b45 into main Nov 25, 2026
22 checks passed
@thymikee
thymikee deleted the t3/improve-cli-intent-routing branch November 25, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant